The assignment x = y is wrong because c11 and c12 are two different types of classes, and objects of differing class type cannot be assigned.
Githiari answered the question on May 12, 2018 at 17:43
- Given the following class, show how an object called ob that passes the value 100 to a and X to c would be declared
class sample...(Solved)
Given the following class, show how an object called ob that passes the value 100 to a and X to c would be declared
class sample {
int a;
char c;
public:
sample(int x, char ch) {a = x; c = ch;}
//...
};
Date posted: May 12, 2018. Answers (1)
- Given the following base class, show how it can be inherited by a derived class called mars
class planet {
int moons;
double dist_from_sun;
double diameter;
double mass
public:
// ...
};(Solved)
Given the following base class, show how it can be inherited by a derived class called mars
class planet {
int moons;
double dist_from_sun;
double diameter;
double mass
public:
// ...
};
Date posted: May 12, 2018. Answers (1)
- Given the following class, what are the names of its constructor and destructor functions?
class widgit {
int x, y;
public :
//.....fill in constructor and destructor functions
};(Solved)
Given the following class, what are the names of its constructor and destructor functions?
class widgit {
int x, y;
public :
//.....fill in constructor and destructor functions
};
Date posted: May 12, 2018. Answers (1)
- Create a class called dice that contains one private integer variable.Create a function called roll() that uses the standard randomn number generator, rand(), to generate...(Solved)
Create a class called dice that contains one private integer variable.Create a function called roll() that uses the standard randomn number generator, rand(), to generate a number between 1 and 6. Then have roll() display that value.
Date posted: May 12, 2018. Answers (1)
- Create a class called prompt in C++ language.Pass its constructor function a prompting string of your choice.Have the constructor display the string and then input...(Solved)
Create a class called prompt in C++ language.Pass its constructor function a prompting string of your choice.Have the constructor display the string and then input an integer.Store this value in a private variable called count.When an object of type prompt is destroyed, ring the bell on the terminal as many times as the user entered.
Date posted: May 12, 2018. Answers (1)
- Is the following fragment valid?
union {
float f;
unsigned int bits;
};(Solved)
Is the following fragment valid?
union {
float f;
unsigned int bits;
};
Date posted: May 12, 2018. Answers (1)
- Modify the following program so that all member functions are automatically in-lined:
#include
using namespace std;
class myclass {
int i, j;
public:
myclass (int x, int y);
void show();
};
myclass ::...(Solved)
Modify the following program so that all member functions are automatically in-lined:
#include
using namespace std;
class myclass {
int i, j;
public:
myclass (int x, int y);
void show();
};
myclass :: myclass(int x, int y)
{
i=x;
j=y;
}
void myclass :: show()
{
cout << i << " " <}
int main()
{
myclass count (2, 3);
count.show();
return 0;
}
Date posted: May 12, 2018. Answers (1)
- What does the following program display?
#include
using namespace std;
int main()
{
int i = 10;
long 1 = 1000000;
double d = -0.0009;
cout << i << ' ' <<1<<...(Solved)
What does the following program display?
#include
using namespace std;
int main()
{
int i = 10;
long 1 = 1000000;
double d = -0.0009;
cout << i << ' ' <<1<< ' '<cout << "\n";
return 0;
}
Date posted: May 12, 2018. Answers (1)
- Create a C++ class called line that draws a line on the screen.Store the line length in a private integer variable called len.Have line's constructor...(Solved)
Create a C++ class called line that draws a line on the screen.Store the line length in a private integer variable called len.Have line's constructor take one parameter: the line length.Have the constructor store the length and actually draw the line .If the system does not support graphics, display the line by using *. Give the line a destructor that erases the line.
Date posted: May 12, 2018. Answers (1)
- Why might the following function not be in-lined by the computer' s compiler
void f1()
{
int i;
for(i=0; i<10; i++) cout <(Solved)
Why might the following function not be in-lined by the computer' s compiler
void f1()
{
int i;
for(i=0; i<10; i++) cout <}
Date posted: May 12, 2018. Answers (1)
- Explain what an anonymous union is and how it differs from a normal union.(Solved)
Explain what an anonymous union is and how it differs from a normal union.
Date posted: May 12, 2018. Answers (1)
- Use a C++ union class to swap the low- and high-order bytes of an integer (assuming 16-bit integer; if the computer uses 32-bit integers, swap...(Solved)
Use a C++ union class to swap the low- and high-order bytes of an integer (assuming 16-bit integer; if the computer uses 32-bit integers, swap the bytes of a short int)
Date posted: May 12, 2018. Answers (1)
- Given the following base C++ class,
class area_cl {
public:
double height;
double width;
};
Create two derived classes called rectangle and isosceles that inherit area_cl. Have each class include a...(Solved)
Given the following base C++ class,
class area_cl {
public:
double height;
double width;
};
Create two derived classes called rectangle and isosceles that inherit area_cl. Have each class include a function called area()
that returns the area of a rectangle or isosceles triangle, as appropriate. Use parameterized constructors to initialize height and width.
Date posted: May 12, 2018. Answers (1)
- Difference between Virus and Trojan(Solved)
Difference between Virus and Trojan
Date posted: May 12, 2018. Answers (1)
- Under network security infrastructure, what do you understand by term Vulnerability (or Weakness)?(Solved)
Under network security infrastructure, what do you understand by term Vulnerability (or Weakness)?
Date posted: May 12, 2018. Answers (1)
- Define with explanations the following terms as used in IT security: (i) Confidentiality (ii) Integrity (iii) Availability (iv) Privacy (v) Identification (vi) Authentication (vii) Authorization (viii) Accountability(Solved)
Define with explanations the following terms as used in IT security
i) Confidentiality
ii) Integrity
iii) Availability
iv) Privacy
v) Identification
vi) Authentication
vii) Authorization
viii) Accountability
Date posted: May 12, 2018. Answers (1)
- Why is information security policy critical in the protection of information and keeping of information systems and data from danger? (Solved)
Why is information security policy critical in the protection of information and keeping of information systems and data from danger?
Date posted: May 12, 2018. Answers (1)
- There are too many situations where the ICC workflows don't produce as well as results as one would hope for and rightfully expect. What accounts...(Solved)
There are too many situations where the ICC workflows don't produce as well as results as one would hope for and rightfully expect. What accounts for these less-than-expected results?
Date posted: May 11, 2018. Answers (1)
- Create a class called box whose constructor function is passed three double values, each of which represents the length of one side of a box.Have...(Solved)
Create a class called box whose constructor function is passed three double values, each of which represents the length of one side of a box.Have the box class compute the volume of the box and store the result in a double variable.Include a member function called vol() that displays the volume of each box object.
Date posted: May 5, 2018. Answers (1)
- Create a class C++ class called t_and_d that is passed the current system time and date as a parameter to its constructor when it is...(Solved)
Create a class C++ class called t_and_d that is passed the current system time and date as a parameter to its constructor when it is created.Have the class include a member function that displays this time and date on the screen.
Date posted: May 5, 2018. Answers (1)